﻿package bdz.common.utils {
	
	import flash.utils.*;
	
	public dynamic class ExecutionTime extends Dictionary {
		private static var instance:ExecutionTime;
		public function ExecutionTime(se:SingletonEnforcer) {
			super();
		}
		public static function getInstance():ExecutionTime {
			if(instance == null){
				instance = new ExecutionTime(new SingletonEnforcer());	
			}
			return instance;
		}
		public function startTimer(alias:Object):void {
			this[alias] = getTimer();
		}
		public function getResult(alias:Object):Number {
			if (!this[alias]) {
				return -1;
			}
			var res:Number = getTimer() - this[alias]
			this[alias] = null;
			
			return res;
		}
		
		
	}
}
internal class SingletonEnforcer {}